package com.tky.conference.base;

import android.app.Activity;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

/**
 * Created by yy on 2015/12/3.
 */
public abstract class BaseActivity extends AppCompatActivity {
    //当前的进程的activity
    private static Activity mForegroundActivity=null;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        initView();
        initDates();
        initToolBar();
        initEvent();
    }
    //初始化界面
    public abstract void initView();
    //初始化数据
    public abstract void initDates();
    //初始化actionbar
    public abstract void initToolBar();
    //初始化事件
    public abstract void initEvent();

    @Override
    protected void onResume() {
        super.onResume();
        this.mForegroundActivity=this;
    }

    @Override
    protected void onPause() {
        super.onPause();
        this.mForegroundActivity=null;
    }

    public static Activity getForegroundActivity(){
        return mForegroundActivity;
    }
}
